package com.xianbeiying.app.ckgl.util;


import java.util.regex.Pattern;

/**
 * 正则
 */
public class RegUtil
{
    public static final String REG_MAIL = "^([\\!#\\$%&'\\*\\+/\\=?\\^`\\{\\|\\}~a-zA-Z0-9_-]+[\\.]?)+[\\!#\\$%&'\\*\\+/\\=?\\^`\\{\\|\\}~a-zA-Z0-9_-]+@{1}((([0-9A-Za-z_-]+)([\\.]{1}[0-9A-Za-z_-]+)*\\.{1}([A-Za-z]){1,6})|(([0-9]{1,3}[\\.]{1}){3}([0-9]{1,3}){1}))$";


    public static boolean matcher(String value, String reg)
    {
        if (value == null || reg == null)
        {
            return false;
        }
        try
        {
            Pattern p = Pattern.compile(reg);
            return p.matcher(value).matches();
        } catch (Exception e)
        {
//            LogUtils.w("matcher exception: value=" + value + ", reg=" + reg, e);
            return false;
        }
    }
    public static CityCallBack back;
    public void getCallBack(CityCallBack back) {
        this.back = back;

    }
    public static CityCallBack back() {
        return back;
    }
}
